package com.cw.jeeyt.api.enums;

import java.util.Arrays;

/**
 * 参数类型枚举
 */
public enum EnumAskType {
    GET("GET","GetMapping"),
    HEAD("HEAD","HeadMapping"),
    POST("POST","PostMapping"),
    PATCH("PATCH","PatchMapping"),
    DELETE("DELETE","DeleteMapping"),
    OPTIONS("OPTIONS","OptionsMapping"),
    TRACE("TRACE","TraceMapping"),
    PUT("PUT","PutMapping");
    private String code;
    private String desc;

    EnumAskType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static EnumAskType find(String code) {
        return Arrays.stream(EnumAskType.values()).filter(input -> input.getCode().equals(code)).findFirst().orElse(null);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
